package com.ycrlkj.android.modulespublic.common.net.response;

import lombok.AllArgsConstructor;
import lombok.Data;

import java.io.Serializable;

/**
 * 某些接口需返回状态数据, 而非业务实体, 比如 add,delete,edit 等接口, 在此定义一个公共状态数据体
 * {code: 2000, message: "成功", data: {status: 0, toast: "需要确认的信息", content: 数据 } }
 */
@Data
@AllArgsConstructor
public class ResultData implements Serializable {

    private Integer status; //0=>正常, 1=>自定义状态

    private String toast; //前端需要显示的消息

    private Object content; //数据

    public ResultData(){
        this.status = 0;
        this.toast = "";
    }

    public ResultData(String toast){
        this.status = 0;
        this.toast = toast;
    }

    public ResultData(Integer status, String toast){
        this.status = status;
        this.toast = toast;
    }
}
